using System.Collections.Generic;
using DslCrossModelFramework.ModelTraversal;
using Microsoft.VisualStudio.Modeling;

namespace DslCrossModelFramework.ModelRelationship {
    /// <summary>
    /// A filter for model element collections
    /// </summary>
    public interface IModelElementFilter {
        /// <summary>
        /// Filters the collection.
        /// </summary>
        /// <param name="collectionToFilter">The collection to filter.</param>
        /// <returns></returns>
        IList<ModelElement> FilterCollection(IEnumerable<ModelElement> collectionToFilter);

        /// <summary>
        /// Determines whether the specified model element is valid for this filter.
        /// </summary>
        /// <param name="modelElement">The model element.</param>
        /// <returns>
        /// 	<c>true</c> if the specified model element is valid for this filter; otherwise, <c>false</c>.
        /// </returns>
        bool IsValid(ModelElement modelElement);


        /// <summary>
        /// Determines whether the specified path segment is valid.
        /// </summary>
        /// <param name="pathSegment">The path segment.</param>
        /// <returns>
        /// 	<c>true</c> if the specified model segment is valid for this filter; otherwise, <c>false</c>.
        /// </returns>
        bool IsValid(LinkedListNode<IModelPathSegment> pathSegment);
    }
}